package com.oocl.ita.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oocl.ita.dao.impl.PersonDao;
import com.oocl.ita.dao.impl.PersonDaoImpl;
import com.oocl.ita.po.Person;

/**
 * Servlet implementation class QueryAllPersonServlet
 */
public class QueryAllPersonServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private PersonDao personDao;
    public QueryAllPersonServlet() {
        super();
       this.personDao = new PersonDaoImpl();
    }
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Person> persons = personDao.showAllPerson();
		request.setAttribute("personList", persons);
		request.getRequestDispatcher("/ShowPersonServlet").forward(request, response);
	}
}
